USE [ventas]
GO

/****** Object:  View [saventa].[vw_user_proy]    Script Date: 08/16/2012 15:54:06 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[saventa].[vw_user_proy]'))
DROP VIEW [saventa].[vw_user_proy]
GO

USE [ventas]
GO

/****** Object:  View [saventa].[vw_user_proy]    Script Date: 08/16/2012 15:54:06 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO







CREATE VIEW [saventa].[vw_user_proy] AS (
SELECT    
 aup.apl_id AS Modulo, 
 aup.[user_id]as Usuario, 
 proy.pro_id AS Codigo_proyecto, 
 proy.pro_descrip AS Proyecto, 
 proy.urb_id AS Codigo_Urbanizacion,  
 proy.pro_sta AS Estado_proyecto
FROM saventa.tb_ven_def_proy AS proy 
	INNER JOIN data.monica.tb_data_par_aup AS aup 
	ON proy.pro_id = aup.pro_id
	--and proy.IdEstado <> 'VE'
WHERE     aup.apl_id = 'VENTAS'
--and proy.pro_id NOT IN ('10670','10669'))
)






GO


